<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1 id="jump"></h1>
<script>

    var count = 3;
    var timer = setInterval(function () {
        if (count > 0) {
            document.getElementById("jump").innerText = count + "秒后跳转首页";
            count--;
        } else {
            clearInterval(timer)
            location.href = "http://www.baidu.com";
        }
    }, 1000);


</script>
</body>
</html>